package com.fastCms.business.mall.enums;

/**
 * 杭州人参大健康管理有限公司 版权所有 © Copyright 2019<br>
 *
 * @Description: 支付状态<br>
 * @Project: healthyPro <br>
 * @CreateDate: Created in 2018/1/13 14:45 <br>
 * @Author: <a href="316659431@qq.com">刘双全</a>
 */
public enum PaidStatusEnum {

    WAIT_PAY(1, "未支付"),
    PAID(2, "已支付");

    private Integer code;
    private String name;

    PaidStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static PaidStatusEnum getEnum(Integer code) {
        for (PaidStatusEnum item : PaidStatusEnum.values()) {
            if (item.code == code) {
                return item;
            }
        }
        return null;
    }

    /**
     * 根据code获取name
     *
     * @param code
     * @return
     */
    public static String getName(Integer code) {
        PaidStatusEnum item = getEnum(code);
        return item != null ? item.name : null;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer key) {
        this.code = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
